package com.flyiu.data.idempotent.model;

import lombok.Data;

/**
 * 
 * <p>默认幂等对象
 * </p>
 *
 * @author flyiu@flyiu.com
 * @version $Id: DefaultIdempotentEntity.java, v 0.1 2018年6月30日 下午6:14:58 flyiu Exp $
 */
public class DefaultIdempotentEntity {

    /**
     * 实体对象ID
     */
    private int    id;

    /**
     * 对象hash值。之所以需要hash值，是用来判断请求对象是否中间被篡改
     */
    private String hash;

    /**
     * 入参
     */
    private String context;

    /**
     * 返回值
     */
    private String response;

    /**
     * 幂等KEY
     */
    private String key;
    
    /**
     * 业务ID
     */
    private String bussinessId;

    /**
     * 状态 初始为I，确认为COMMIT
     */
    private String state = "I";

    /**
     * 幂等性方法名称
     */
    private String name;

    /**
     * Getter method for property <tt>id</tt>.
     * 
     * @return property value of id
     */
    public int getId() {
        return id;
    }

    /**
     * Setter method for property <tt>id</tt>.
     * 
     * @param id value to be assigned to property id
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * Getter method for property <tt>hash</tt>.
     * 
     * @return property value of hash
     */
    public String getHash() {
        return hash;
    }

    /**
     * Setter method for property <tt>hash</tt>.
     * 
     * @param hash value to be assigned to property hash
     */
    public void setHash(String hash) {
        this.hash = hash;
    }

    /**
     * Getter method for property <tt>context</tt>.
     * 
     * @return property value of context
     */
    public String getContext() {
        return context;
    }

    /**
     * Setter method for property <tt>context</tt>.
     * 
     * @param context value to be assigned to property context
     */
    public void setContext(String context) {
        this.context = context;
    }

    /**
     * Getter method for property <tt>response</tt>.
     * 
     * @return property value of response
     */
    public String getResponse() {
        return response;
    }

    /**
     * Setter method for property <tt>response</tt>.
     * 
     * @param response value to be assigned to property response
     */
    public void setResponse(String response) {
        this.response = response;
    }

    /**
     * Getter method for property <tt>key</tt>.
     * 
     * @return property value of key
     */
    public String getKey() {
        return key;
    }

    /**
     * Setter method for property <tt>key</tt>.
     * 
     * @param key value to be assigned to property key
     */
    public void setKey(String key) {
        this.key = key;
    }

    /**
     * Getter method for property <tt>bussinessId</tt>.
     * 
     * @return property value of bussinessId
     */
    public String getBussinessId() {
        return bussinessId;
    }

    /**
     * Setter method for property <tt>bussinessId</tt>.
     * 
     * @param bussinessId value to be assigned to property bussinessId
     */
    public void setBussinessId(String bussinessId) {
        this.bussinessId = bussinessId;
    }

    /**
     * Getter method for property <tt>state</tt>.
     * 
     * @return property value of state
     */
    public String getState() {
        return state;
    }

    /**
     * Setter method for property <tt>state</tt>.
     * 
     * @param state value to be assigned to property state
     */
    public void setState(String state) {
        this.state = state;
    }

    /**
     * Getter method for property <tt>name</tt>.
     * 
     * @return property value of name
     */
    public String getName() {
        return name;
    }

    /**
     * Setter method for property <tt>name</tt>.
     * 
     * @param name value to be assigned to property name
     */
    public void setName(String name) {
        this.name = name;
    }
}
